using UnityEngine;
using System.Collections;

public class PlayerAnimationsManager : DrawableGameObject 
{
	private PlayerState playerState;
	
	public Texture2D[] normalTextures;
	public Texture2D[] anubisTextures;
	public Texture2D[] laserTextures;
	public Texture2D[] dyingTextures;
	
	public override void Start ()
	{
		base.Start();
		SetAnimations(normalTextures, anubisTextures, laserTextures, dyingTextures, null);
	}
	
	void Update () 
	{
		playerState = GameObject.FindGameObjectWithTag(Tags.PLAYER).GetComponent<PlayerMechanic>().getPlayerState();
	
		if(playerState == PlayerState.Normal)
		{
			RunAnimation("First", "Loop");
		}
		
		if(playerState == PlayerState.ScaryDogMode)
		{
			RunAnimation("Second", "Loop");
		}
		
		if(playerState == PlayerState.LaserMode)
		{
			RunAnimation("Third", "Loop");
		}
		
		if(playerState == PlayerState.DyingMode)
		{
			RunAnimation("Fourth", "OneShot");
		}
	}
}
